package com.shenxuchen.crm.service;

import com.shenxuchen.crm.mapper.TypeMapper;
import com.shenxuchen.crm.pojo.Type;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TypeServiceImpl implements TypeService {

    @Resource
    private TypeMapper typeMapper;

    public List<Type> getAll() {
        return typeMapper.getAll();
    }

    public void save(Type type) {
        typeMapper.save(type);
    }

    public Boolean getExists(String code) {
        Type type = typeMapper.getByCode(code);
        return type != null;
    }

    public Type getByCode(String code) {
        return typeMapper.getByCode(code);
    }

    public void edit(Type type) {
        typeMapper.edit(type);
    }

    public void delete(String[] codes) {
        typeMapper.delete(codes);
    }
}
